/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lucene.Analyzers;

import old.PositionTwitterFilter_NoHashtags;
import java.io.Reader;
import java.util.Set;
import lucene.Analyzers.stantard.StandardAnalyzer;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.LowerCaseTokenizer;
import org.apache.lucene.analysis.PorterStemFilter;
import org.apache.lucene.analysis.StopAnalyzer;
import org.apache.lucene.analysis.StopFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.WhitespaceTokenizer;
import org.apache.lucene.analysis.standard.StandardFilter;

public class PositionTwitterAnalyzer extends Analyzer {
    private Set stopWords;
    
    public PositionTwitterAnalyzer() {
        this(StopAnalyzer.ENGLISH_STOP_WORDS);
    }
    
    public PositionTwitterAnalyzer(String[] stopList) {
        stopWords = StopFilter.makeStopSet(stopList);
    }
    
    public TokenStream tokenStream(String fieldName, Reader reader) {
        return new PositionTwitterFilter_NoHashtags(new StandardAnalyzer().tokenStream(fieldName, reader));
    }

}
